pvh dom0: add and remove foreign pages
authorMukesh Rathor <mukesh.rathor@oracle.com>
Mon, 2 Jun 2014 08:30:47 +0000 (10:30 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 2 Jun 2014 08:30:47 +0000 (10:30 +0200)
commit50fe6e737059a98e8a5242a7616e4cdcb60988c2
tree8bdfc69f50c7c823df75b8ffe460c13608684fd3
parent03d745c8bfbf45df39eb453ff1e7787b856c4368
pvh dom0: add and remove foreign pages

In this patch, a new function, p2m_add_foreign(), is added
to map pages from a foreign guest into dom0 for various purposes
like domU creation, running xentrace, etc... Such pages are
typed p2m_map_foreign.  Note, it is the nature of such pages
that a refcnt is held during their stay in the p2m. The
refcnt is added and released in the low level ept function
atomic_write_ept_entry. That macro is converted to a function to allow
for such refcounting, which only applies to leaf entries in the ept.
Furthermore, please note that paging/sharing is disabled if the
controlling or hardware domain is pvh. Any enabling of those features
would need to ensure refcnt are properly maintained for foreign types,
or paging/sharing is skipped for foreign types.

Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
Reviewed-by: Tim Deegan <tim@xen.org>
xen/arch/x86/mm.c
xen/arch/x86/mm/mem_event.c
xen/arch/x86/mm/p2m-ept.c
xen/arch/x86/mm/p2m-pt.c
xen/arch/x86/mm/p2m.c
xen/include/asm-x86/p2m.h